home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / vlapak1.zip / INT9.ZIP / INT9.ASM < prev    next >
Assembly Source File  |  1993-07-26  |  2KB  |  89 lines

  1. ────────────────────────────────────────────────────────────────────────────
  2. ;
  3. ;   This code was written by Draeden of VLA on June 28, 1993.
  4. ;
  5. ────────────────────────────────────────────────────────────────────────────    
  6.     IDEAL
  7.     MODEL SMALL
  8.     STACK 200h
  9.     CODESEG
  10.     P386N
  11.     LOCALS
  12. ────────────────────────────────────────────────────────────────────────────
  13. OldInt9     dd  ?
  14.  
  15. INCLUDE     "Int9.INC"
  16. ────────────────────────────────────────────────────────────────────────────
  17.     ────────────────────────────────────────────────────────────────────
  18.     ; Takes the info in Active_Keys and displays it graphically
  19.     ────────────────────────────────────────────────────────────────────
  20. PROC Display_Keys
  21.     pusha
  22.     push    ds es
  23.  
  24.     mov     ax,cs
  25.     mov     ds,ax
  26.     mov     ax,0b800h
  27.     mov     es,ax
  28.  
  29.     xor     bx,bx           ;start on key # 0
  30.     mov     si,bx
  31.     mov     cx,10
  32. @@Key_Disp_Loop:
  33.     cmp     [Active_Keys + bx],0
  34.     je      @@Off_Key
  35.     mov     [WORD es:si],"■" + 1*100h
  36.     jmp     short @@END
  37. @@OFF_KEY:
  38.     mov     [WORD es:si],"·" + 1*100h
  39. @@END:
  40.     add     si,2
  41.     dec     cx
  42.     jne     @@NotAt10
  43.     add     si,160-20
  44.     mov     cx,10
  45. @@NotAt10:
  46.     inc     bx
  47.     cmp     bx,128
  48.     jb      @@Key_Disp_Loop
  49.  
  50.     pop     es ds
  51.     popa
  52.     ret
  53. ENDP
  54. ────────────────────────────────────────────────────────────────────────────
  55. START:
  56.     mov     ax,cs
  57.     mov     ds,ax
  58.  
  59.     mov     ax,3
  60.     int     10h
  61.  
  62.     mov     bx,9
  63.     mov     si,offset OldInt9
  64.     mov     ax,cs
  65.     shl     eax,16
  66.     mov     ax,offset Int_09
  67.     call    Install_Int
  68.  
  69.     xor     bl,bl   
  70.     call    SetKb               ;make sure all the lights are off
  71.  
  72. @@MainLoop:
  73.     cmp     [ESC_Pressed],0
  74.     jne     @@All_Done
  75.  
  76.     call    Display_Keys
  77.  
  78.     jmp     @@MainLoop
  79.  
  80. @@All_Done:
  81.     mov     bx,9
  82.     mov     si,offset OldInt9
  83.     call    Restore_Int
  84.  
  85.     mov     ax,4c00h
  86.     int     21h
  87. END START
  88.  
  89.